package com.bwie.controller;

import com.bwie.pojo.TbSheet;
import com.bwie.service.IUserService;
import com.bwie.service.TbNetworkService;
import com.bwie.service.TbSheetService;
import com.bwie.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * description:
 *
 * @Author caoshuaifeng
 * @Create 2025/4/17 10:09
 * @Version 1.0
 */
@RestController
@RequestMapping("/system/index")
public class IndexController {
    @Autowired
    IUserService iUserService;
    @Autowired
    TbNetworkService tbNetworkService;

    @Autowired
    TbSheetService tbSheetService;
    /**
     * 服务采用opf远程调用，并设置熔断机制
     * @param userId
     * @return
     */

    @PostMapping("getUserById1/{userId}")
    public R getUserById1(@PathVariable("userId") Integer userId){
      return   iUserService.getUserById(userId);


    }

    /**
     * 获取网办类型表
     * @return
     */
    @PostMapping("/getNetworkList")
    public R getNetworkList(){
        return tbNetworkService.getNetworkList();

    }

    /**
     * 获取上报数据信息
     */

    @PostMapping("/getSheetList")
    public R getSheetList(){
        return tbSheetService.getSheetList();

    }

    /**
     * 开启上报接口
     *
     */

    @PostMapping("/addSheet")
    public R addSheet(@RequestBody TbSheet tbSheet){
        return tbSheetService.addSheet(tbSheet);

    }

    /**
     * 获取授权机构列表
     */

    @PostMapping("/getAuthList")
    public R getAuthList(){
        return tbSheetService.getAuthList();

    }


}
